package maple

object CaseTest {

}

case object +: {

  def unapply[T] (input: List[T]) = {
    if(input.isEmpty) None else Some((input.head,input.tail))
  }


  def main(args: Array[String]): Unit = {
     val res = 1 +: 7 +: 2 +: 9 +: Nil match {
                  case first +: second +: rest => first + second + rest.length
              }
    println(res)
  }
}
